/*
Copyright 2010  Murali Devi (profdevi@gmail.com)

This file is part of ComineGL Project.

ComineGL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ComineGL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ComineGL.  If not, see <http://www.gnu.org/licenses/>.

This code uses the irrlicht and irrklang libraries.  Please read
the libraries copyrights at 

	irrlicht library:  http://irrlicht.sourceforge.net
	irrklang library:  http://www.ambiera.com/irrklang

*/



//v1.5 copyright Comine.com 20101211S22
#ifndef MCGLNodeInfo_h
#define MCGLNodeInfo_h

///////////////////////////////////////////////////
#include "MStdLib.h"
#include "MIrrlicht.h"

//******************************************************
//**  MCGLNodeInfoType class
//******************************************************
enum MCGLNodeInfoType
	{
	// Basic Node Types 
	CGLNIT_CUBE=0,
	CGLNIT_SPHERE,
	CGLNIT_TEXT,
	CGLNIT_WATER_SURFACE,
	CGLNIT_TERRAIN,
	CGLNIT_SKY_BOX,
	CGLNIT_SKY_DOME,
	CGLNIT_SHADOW_VOLUME,
	CGLNIT_OCT_TREE,
	CGLNIT_MESH,
	CGLNIT_LIGHT,
	CGLNIT_EMPTY,
	CGLNIT_DUMMY_TRANSFORMATION,
	CGLNIT_CAMERA,
	CGLNIT_CAMERA_MAYA,
	CGLNIT_CAMERA_FPS,
	CGLNIT_BILLBOARD,
	CGLNIT_ANIMATED_MESH,
	CGLNIT_PARTICLE_SYSTEM,
	CGLNIT_FONT_TEXT,
	CGLNIT_LOD
	};


//******************************************************
//**  MCGLNodeInfo class
//******************************************************
class MCGLNodeInfo
	{
	////////////////////////////////////////////////
	ISceneManager *mSceneMgr;		// Reference to scene mgr
	ISceneNode *mNode;				// Reference to Scene Node
	bool mRemoveOnDelete;			// Remove Node from Scene Graph On Delete
	MCGLNodeInfoType mNodeType;		// Scene Node Type
	bool (*mLODCallBack)(class MSGAEngine3D &engine,float cameradistance2
			,int nodeid,void *extra);
	void *mLODCallBackExtra;
	float mVelocityX;				// Hold velocty of node (relative to parent)
	float mVelocityY;
	float mVelocityZ;
	float mRotationalX;				// Rotational x,y,z
	float mRotationalY;
	float mRotationalZ;

	////////////////////////////////////////////////
	void ClearObject(void);
	
	////////////////////////////////////////////////
	public:
	MCGLNodeInfo(void);
	MCGLNodeInfo(ISceneManager *scnmgr,ISceneNode *node,MCGLNodeInfoType nodetype);
	~MCGLNodeInfo(void);
	bool Create(ISceneManager *scnmgr,ISceneNode *node,MCGLNodeInfoType nodetype);
	bool Destroy(void);
	ISceneNode *GetNode(void);
	bool SetRemoveOnDelete(bool value);	// Remove Node from scene graph on delete
	MCGLNodeInfoType GetNodeType(void);	// Get Scene Node Type
	bool SetLODCallBack(bool lodcallback(class MSGAEngine3D &engine
			,float cameradistance2,int nodeid,void *extra),void *extra);
	bool GetLODCallBack(bool (*&lodcallback)(class MSGAEngine3D &engine
			,float cameradistance2,int nodeid,void *extra),void *&extra);	
	const char *GetTypeName(void);
	MCGLNodeInfoType GetType(void);
	bool ClearRotation(void);
	bool ClearVelocity(void);
	bool SetRotation(const float &rx,const float &ry,const float &rz);
	bool SetVelocity(const float &vx,const float &vy,const float &vz);
	bool GetRotation(float &rx,float &ry,float &rz);
	bool GetVelocity(float &rx,float &ry,float &rz);
	bool ClearAnimators(void);
	};

#endif // MCGLNodeInfo_h

